import request from '@/request';
import type {editFormData , addFormData} from '../@types/index';

/**获取banner列表*/
export const getBanner = (params: { page: number, pageSize: number , title ?: string}) => {
    return request({
        url: '/api/v2/admin/getBanner',
        method: 'get',
        params
    })
} 

/**添加banner*/
export const addBanner = (data: addFormData ) => request({
    url: '/api/v2/admin/addBanner',
    method: 'post',
    data
}) 

/**删除banner*/
export const delBanner = (data: { ID: string }) => request({
    url: '/api/v2/admin/delBanner',
    method: 'post',
    data
})

/**更新banner*/
export const updataBanner = (data: editFormData) => request({
    url: '/api/v2/admin/updataBanner',
    method: 'post',
    data
})